package com.parking.status.sync.netty.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.parking.status.sync.netty.util.PojoMapper;

/**
 * Created by Administrator on 2015/9/18.
 */
public class ResponseTemp extends ResponsePre {

    @JsonIgnore
    private String totalBody;

    public String getTotalBody() {
        return totalBody;
    }

    public void setTotalBody(String totalBody) {
        this.totalBody = totalBody;
    }

    public ResponsePre toResponseDetail() {
        ResponsePre ret = null;
        if(this.code.equalsIgnoreCase(MessageType.CODE_SYNC_PARKING_INFO)) {

            ret = PojoMapper.fromJson(totalBody, ResponseSyncParkingInfo.class);
        } else {
            ret = this;
        }
        return ret;
    }
}
